<?php
$users = $this->requestAction(array('controller' => 'users', 'action' => 'getTopUser'));
?>
<!-- .section -->
<div class="section">
	<h2 class="title">人気講師</h2>
	<ul class="list teacher clearfix">
		<?php foreach ($users as $user):?>
		<li>
			<a href="<?php echo $this->Html->url(array('controller' => 'profile', 'action' => 'view', $user['User']['id']));?>">
				<?php if ($avatar = $user['Profile']['icon_image']):?>
				<?php echo $this->Html->image(Configure::read('User.upload_path_prefix') . $avatar, array('alt' => '', 'width' => 111, 'height' => 111));?>
				<?php else:?>
				<?php echo $this->Html->image('icon.jpg', array('alt' => '', 'width' => 111, 'height' => 111));?>
				<?php endif;?>
			</a>
			<h3 class="name">
				<?php
				echo $this->Html->link(
					$this->User->getUsername($user),
					array('controller' => 'profile', 'action' => 'view', $user['User']['id'])
				);
				?></h3>
			<p class="description"><?php echo $user['Profile']['description'];?></p>
		</li>
		<?php endforeach;?>
	</ul>
</div>
<!-- /.section -->
